resource "huaweicloud_networking_secgroup" "mod_vsg" {
  name                  = var.name
  description           = var.description
  enterprise_project_id = var.enterprise_project_id
}


resource "huaweicloud_networking_secgroup_rule" "mod_vsg_rule" {
  security_group_id = huaweicloud_networking_secgroup.mod_vsg.id
  direction         = var.direction
  ethertype         = var.ethertype
  action            = var.action
  protocol          = var.protocol
  ports             = var.ports
  priority          = 1
  remote_ip_prefix  = var.remote_ip_prefix
}